<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic
  PUBLIC "-//OASIS//DTD DITA Composite//EN" "ditabase.dtd">
<topic id="topic1">
  <title id="ot133181">gpmovemirrors</title>
  <body>
    <p>Moves mirror segment instances to new locations.</p>
    <section id="section2">
      <title>Synopsis</title>
      <codeblock>gpmovemirrors -i &lt;move_config_file> [-d &lt;master_data_directory>] 
          [-l &lt;logfile_directory>] [-b &lt;segment_batch_size>]
          [-B &lt;batch_size>] [-v] [--hba-hostnames &lt;boolean>] 

gpmovemirrors -? 

gpmovemirrors --version</codeblock>
    </section>
    <section id="section3">
      <title>Description</title>
      <p>The <codeph>gpmovemirrors</codeph> utility moves mirror segment instances to new locations.
        You may want to move mirrors to new locations to optimize distribution or data storage.</p>
      <p>By default, the utility will prompt you for the file system location(s) where it will move
        the mirror segment data directories.</p>
      <p>You must make sure that the user who runs <codeph>gpmovemirrors</codeph> (the
          <codeph>gpadmin</codeph> user) has permissions to write to the data directory locations
        specified. You may want to create these directories on the segment hosts and
          <codeph>chown</codeph> them to the appropriate user before running
          <codeph>gpmovemirrors</codeph>.</p>
    </section>
    <section id="section4">
      <title>Options</title>
      <parml>
        <plentry>
          <pt>-b <varname>segment_batch_size</varname></pt>
          <pd>The maximum number of segments per host to operate on in parallel. Valid values are
              <codeph>1</codeph> to <codeph>128</codeph>. If not specified, the utility will start
            recovering up to 64 segments in parallel on each host. </pd>
        </plentry>
        <plentry>
          <pt>-B <varname>batch_size</varname></pt>
          <pd>The number of hosts to work on in parallel. If not specified, the utility will start
            working on up to 16 hosts in parallel. Valid values are <codeph>1</codeph> to
              <codeph>64</codeph>. </pd>
        </plentry>
        <plentry>
          <pt>-d <varname>master_data_directory</varname></pt>
          <pd>The master data directory. If not specified, the value set for
              <codeph>$MASTER_DATA_DIRECTORY</codeph> will be used.</pd>
        </plentry>
        <plentry>
          <pt>--hba-hostnames <varname>boolean</varname></pt>
          <pd>Optional. Controls whether this utility uses IP addresses or host names in the
              <codeph>pg_hba.conf</codeph> file when updating this file with addresses that can
            connect to Greenplum Database. When set to 0 -- the default value -- this utility uses
            IP addresses when updating this file. When set to 1, this utility uses host names when
            updating this file. For consistency, use the same value that was specified for
              <codeph>HBA_HOSTNAMES</codeph> when the Greenplum Database system was initialized. For
            information about how Greenplum Database resolves host names in the
              <codeph>pg_hba.conf</codeph> file, see <xref href="../../admin_guide/client_auth.html" format="html" scope="external"
            >Configuring Client Authentication</xref>.</pd>
        </plentry>
        <plentry>
          <pt>-i <varname>move_config_file</varname></pt>
          <pd>A configuration file containing information about which mirror segments to move, and
            where to move them. </pd>
          <pd>You must have one mirror segment listed for each primary segment in the system. Each
            line inside the configuration file has the following format (as per attributes in the
              <codeph>gp_segment_configuration</codeph> catalog table):</pd>
          <pd>
            <codeblock>&lt;old_address>|&lt;port>|&lt;data_dir> &lt;new_address>|&lt;port>|&lt;data_dir></codeblock>
          </pd>
          <pd>Where <codeph>&lt;old_address></codeph> and <codeph>&lt;new_address></codeph> are the
            host names or IP addresses of the segment hosts, <codeph>&lt;port></codeph> is the
            communication port, and <codeph>&lt;data_dir></codeph> is the segment instance data
            directory.</pd>
        </plentry>
        <plentry>
          <pt>-l <varname>logfile_directory</varname></pt>
          <pd>The directory to write the log file. Defaults to <codeph>~/gpAdminLogs</codeph>.</pd>
        </plentry>
        <plentry>
          <pt>-v (verbose)</pt>
          <pd>Sets logging output to verbose.</pd>
        </plentry>
        <plentry>
          <pt>--version (show utility version)</pt>
          <pd>Displays the version of this utility.</pd>
        </plentry>
        <plentry>
          <pt>-? (help)</pt>
          <pd>Displays the online help.</pd>
        </plentry>
      </parml>
    </section>
    <section id="section5">
      <title>Examples</title>
      <p>Moves mirrors from an existing Greenplum Database system to a different set of hosts:</p>
      <codeblock>$ gpmovemirrors -i move_config_file</codeblock>
      <p>Where the <codeph>move_config_file</codeph> looks something like this:</p>
      <codeblock>sdw2|50000|/data2/mirror/gpseg0 sdw3|50000|/data/mirror/gpseg0
sdw2|50001|/data2/mirror/gpseg1 sdw4|50001|/data/mirror/gpseg1
sdw3|50002|/data2/mirror/gpseg2 sdw1|50002|/data/mirror/gpseg2
</codeblock>
    </section>
  </body>
</topic>
